﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.DataModel;
using YArchitech.LIB;

namespace YArchitech.HVAC
{
	public partial class FrmAutoNumber : System.Windows.Forms.Form
	{
		public FrmAutoNumber()
		{
			this.InitializeComponent();
			new YJKProcessTools().ShowInTaskbarChange(this);
			base.Icon = Resource.YArchitechIcon;
			this.userSetting = new HVACUserSetting();
			string a = this.userSetting.ReadValue("AutoNumber", "SetNums");
			if (a == "" || a == "0" || a == "true")
			{
				this.radioButton1.Checked = true;
				return;
			}
			if (a == "1")
			{
				this.rbNumbyPipe.Checked = true;
				return;
			}
			this.radioButton2.Checked = true;
		}

		private void button1_Click(object sender, EventArgs e)
		{
			string value;
			if (this.radioButton1.Checked)
			{
				value = "0";
			}
			else if (this.rbNumbyPipe.Checked)
			{
				value = "1";
			}
			else
			{
				value = "2";
			}
			this.userSetting.WriteValue("AutoNumber", "SetNums", value);
			base.DialogResult = DialogResult.OK;
			base.Close();
		}

		private void button2_Click(object sender, EventArgs e)
		{
			base.DialogResult = DialogResult.Cancel;
			base.Close();
		}

		private HVACUserSetting userSetting;
	}
}
